﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace WpfScratchApp
{
    /// <summary>
    /// Interaction logic for BindingExample.xaml
    /// </summary>
    public partial class BindingExample : Window
    {
        public BindingExample()
        {
            var source = new BindableObject();
            var dest = new BindableObject();
            
            InitializeComponent();
            
            var xaml = XamlWriter.Save(btnTest.Template);

            var binding = new Binding();
            
            //binding.Source = txtSource;
            binding.Source = source;
            
            binding.Path = new PropertyPath("Text");
            
            //txtDest.SetBinding(TextBox.TextProperty, binding);
            BindingOperations.SetBinding(dest, BindableObject.TextProperty, binding);

            source.Text = "Check if this updates in dest too?";
        }
    }
}
